function getInputSomething(): string {
  return '1341534';
}

function loadFromDatabase(id: number): { id: number, name: string, age: number } | undefined {
  if (isNaN(id)) return;

  // ... load from database
  return {
    id,
    name: '张三',
    age: 18
  };
}


let s: string = getInputSomething();
let id: number = parseInt(s); // NaN
let result = loadFromDatabase(id);
if (result) {
  let { name, age } = result;
  console.log(name, age);
} else {
  console.log('Data not found');
}